/*
 * Copyright 2008. Mount Sinai Hospital, Toronto, Canada.
 * 
 * Licensed under the Apache License, Version 2.0. You
 * can find a copy of the license at:
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * IN NO EVENT SHALL MOUNT SINAI HOSPITAL BE LIABLE TO ANY PARTY FOR DIRECT, 
 * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST 
 * PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, 
 * EVEN IF MOUNT SINAI HOSPITAL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 
 * DAMAGE.
 * 
 * MOUNT SINAI HOSPITAL SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF 
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE AND 
 * ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS IS". 
 * MOUNT SINAI HOSPITAL HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, 
 * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 
 */

package com.sinai.mshab.data.gwt;

import com.google.gwt.user.client.ui.RichTextArea;
import com.sinai.mshab.data.core.DataManager;

/**
 * Specifically manages setting and getting of the HTML inside as 
 * {@link RichTextArea} widget.  
 * @author Jason Kong
 *
 */
public class RichTextAreaHTMLDataManager implements 
	DataManager<RichTextArea, String> {
	
	/**
	 * Gets the HTML data out of the specified {@link RichTextArea} widget
	 * @param widget The  {@link RichTextArea} widget to get data from
	 * @return a String of the HTML data from within the widget 
	 */
	public String getData(RichTextArea widget) {
		return widget.getHTML();
	}

	/**
	 * sets the HTML data  of the specified {@link RichTextArea} widget
	 * @param a String of HTML to set to the widget 
	 */
	public void setData(RichTextArea widget, String data) {
		widget.setHTML(data);
	}

}
